var Translate = function(key){
  var locale = window.locale;
  if(locale.toLowerCase().indexOf('zh') >= 0 && i18n_zh[key]){
      return i18n_zh[key]  
  } else if(i18n_en[key]){
    return i18n_en[key]
  } else{
    return key;
  }
}

var i18n_en = {
  validate_email: 'Please enter a valid email address.',
  validate_minlength: "Please enter at least {0} characters.",
  sms_count_down: function(second){
    return second + ' S';
  },
  resend: 'Resend',
  required: 'This field is required.'
}


var i18n_zh = {
  validate_email: '请输入正确的邮箱地址',
  validate_minlength: "请至少输入{0}个字符",
  sms_count_down: function(second){
    return second + 'S';
  },
  resend: '重发',
  required: '必填'
}